package com.chenjf.controller;

import com.chenjf.po.Page;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("departs")
public class DepartController {

    @GetMapping("list")
    public String list() {
        System.out.println("hello departs list");
        return "departs ok!";
    }

    @GetMapping("/list1/{page}/{pageSize}")
    public String list1(@PathVariable Integer page, @PathVariable Integer pageSize) {
        System.out.println("hello departs list1");
        System.out.println("page = " + page);
        System.out.println("pageSize = " + pageSize);
        return "departs ok!";
    }

    @PostMapping("list2")
    public String list2(@RequestParam Integer page, @RequestParam Integer pageSize) {
        System.out.println("hello departs list1");
        System.out.println("page = " + page);
        System.out.println("pageSize = " + pageSize);
        return "departs ok!";
    }

    @PostMapping("list3")
    public String list3(@RequestBody Page page) {
        System.out.println("hello departs list3");
        System.out.println("page = " + page);
        return "departs ok!";
    }
}
